package com.dmgo.common;

import org.hibernate.Session;
import com.dmgo.persistence.HibernateUtil;

public class App 
{
    public static void main( String[] args )
    {
        System.out.println("Maven + Hibernate + MySQL");
        Session session = HibernateUtil.getSessionFactory().openSession();
        
        session.beginTransaction();
        Stock stock = new Stock();
        
        stock.setStockCode("4715");
        stock.setStockName("GENM");
        
        session.save(stock);


       // System.out.println(stock);
        session.delete(stock);

        Way way = new Way( "some Way NAme", "Some way description");
        session.save(way);

        System.out.println(way.toString());
        session.delete(way);

        session.getTransaction().commit();
        
        
    }
}
